FROM phpswoole/swoole:6.0-php8.1

RUN docker-php-ext-install pcntl

RUN echo "deb https://mirrors.tencent.com/debian/ bookworm main non-free non-free-firmware contrib \
          deb-src https://mirrors.tencent.com/debian/ bookworm main non-free non-free-firmware contrib \
          deb https://mirrors.tencent.com/debian-security/ bookworm-security main \
          deb-src https://mirrors.tencent.com/debian-security/ bookworm-security main\
          deb https://mirrors.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib \
          deb-src https://mirrors.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib\
          deb https://mirrors.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib\
          deb-src https://mirrors.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib" >> /etc/apt/sources.list && apt update

# 更新包列表并安装编译所需的依赖
RUN apt-get update && apt-get install -y \
    libfreetype6-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    libzip-dev \
    zip \
    unzip \
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
    && docker-php-ext-install gd zip
